The Java language lacks the important notions of
    \emph{ownership} (an object owns its representation to prevent unwanted
    aliasing)
    and \emph{immutability} (the division into mutable, immutable, and
    readonly data and references).
Programmers are prone to design errors,
    such as representation exposure or violation of immutability contracts.
This paper presents \emph{Ownership Immutability Generic Java} (OIGJ),
    a backward-compatible purely-static language extension supporting
    ownership and immutability.
We formally defined a core calculus for OIGJ, based on Featherweight Java, and proved it sound.
We also implemented OIGJ and performed case studies on 33,000 lines of code.

Creation of immutable cyclic structures requires a ``\emph{cooking phase}'' in which
    the structure is mutated but the outside world cannot observe this mutation.
OIGJ uses \emph{ownership} information to facilitate creation of \emph{immutable} cyclic structures,
    by safely prolonging the cooking phase even after the constructor finishes.

%OIGJ builds on previous work on ownership (OGJ) and immutability (IGJ),
%    and extends them with % owner polymorphic methods,
%    scoped regions, existential owners,
%    and other enhancements stemming from %the delicate
%    intricacies
%    between ownership and immutability.
%    For example, ownership information eases creation of immutable cyclic data-structures.

OIGJ is easy for a programmer to use,
    and it is easy to implement
    (flow-insensitive, adding only 14 rules to those of Java).
Yet, OIGJ is more expressive than previous ownership languages,
    in the sense that it can type-check more good code.
OIGJ can express the factory and visitor patterns, and
OIGJ can type-check
    Sun's \code{java.util} collections (except for the \code{clone} method)
    without refactoring and with only a small number of annotations.
Previous work required major refactoring of existing code in
    order to fit its ownership restrictions.
Forcing refactoring of well-designed code is undesirable
    because it costs programmer effort,
    degrades the design,
    and hinders adoption in the mainstream community.

% The paper will show that for OIGJ
%    ``the whole is greater than the sum of its parts'',

\label{dummy-label-for-etags}

% LocalWords:  readonly util
